eeprom_sources = [
    'eeprom.cpp',
    'eeprom_abi.cpp',
] + chip_interface_sources

eeprom_headers = [
    'eeprom.h',
]

install_headers(eeprom_headers, install_dir: install_inc_dir / 'chip/eeprom')

eeprom_lib = shared_library(
    'Eeprom',
    eeprom_sources,
    include_directories: [include_dirs, chip_inc, '..', '../..', '../../internal/chip/chip_eeprom', '../../internal/bus/bus_base'],
    dependencies: [internal_dep, libmcpp_deps],
    name_prefix: 'lib',
    name_suffix: 'so',
    install: true,
    install_dir: drivers_install_dir,
)

eeprom_dep = declare_dependency(
    link_with: eeprom_lib,
    dependencies: [internal_dep, libmcpp_deps],
) 

if build_tests
  custom_target(
    'copy_eeprom',
    output: 'copy_eeprom',
    command: ['cp', eeprom_lib.full_path(), drivers_install_dir],
    depends: eeprom_lib,
    build_by_default: true,
  )
endif 